home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / drvtypes.zip / DRVTYPES.C next >
Text File  |  1988-03-03  |  1KB  |  37 lines

  1. /* Compiled with Turbo-C V-1.5 */
  2.  
  3. #include <stdio.h>
  4. #include <dos.h>
  5.  
  6.  
  7. main() {
  8.     int    segm = 0xf000;
  9.     unsigned baseoff = 0xe401;
  10.     int    cyl;
  11.     char    heads;
  12.     int    precom;
  13.     char    cntrl;
  14.     int    land;
  15.     char    sect;
  16.     int    i;
  17.     long    cap;
  18.     printf("Drive  Cylind.  Heads  Write    Control  Landing   Sectors     Format.\n");
  19.     printf("type                   precomp.  byte    zone      per track.  capac.\n");
  20.  
  21.     for(i=0;i<47;i++) {
  22.         cyl = peek(segm, baseoff+(unsigned)(i*16));
  23.         heads = peekb(segm, baseoff+(unsigned)(i*16+2));
  24.         precom = peek(segm, baseoff+(unsigned)(i*16+5));
  25.         cntrl = peekb(segm,baseoff+(unsigned)(i*16+8));
  26.         land = peek(segm, baseoff+(unsigned)(i*16+12));
  27.         sect = peekb(segm, baseoff+(unsigned)(i*16+14));
  28.         cap = (long)(sect*512)*(long)(heads*cyl);
  29.         cap /= 1000000L;
  30.         if(precom != -1)
  31.             printf("%3d %7d %7d %9d %7d %8d %10d %8dMb\n",i+1,cyl,
  32.             (int)heads,precom,cntrl,land,(int)sect,(int)cap);
  33.         else
  34.             printf("%3d %7d %7d %9s %7d %8d %10d %8dMb\n",i+1,cyl,
  35.             (int)heads,"none",cntrl,land,(int)sect,(int)cap);
  36.     }
  37. }